abstract class Figure1{
	double dim1, dim2;
	Figure1(double a, double b){
		this.dim1 = a;
		this.dim2 = b;
	}
	abstract double area();
}
class Rectangle1 extends Figure1{
	Rectangle1(double a, double b){
		super(a,b);
	}
	double area(){
		System.out.println("Inside Rectangle Class");
		return dim1*dim2;
	}
}
class Triangle1 extends Figure1{
	Triangle1(double a, double b){
		super(a,b);
	}
	double area(){
		System.out.println("Inside Traingle Class");
		return (dim1*dim2)/2;
	}
}
public class FindAreadAbstract {
	public static void main(String[] args){
		Rectangle1 r = new Rectangle1(1,2);
		Triangle1 t = new Triangle1(3,4);
		Figure1 figure;
		figure = r;
		System.out.println("Area of rectangle is: " + figure.area());
		
		figure = t;
		System.out.println("Area of Traingle is: " + figure.area());
	}
}
